

public class Main {
	public static void main(String[] args) {

		// args
		if (args != null && args.length > 0) {
			System.out.println("args");
			for (String aArg : args) {
				System.out.println(aArg);
			}
		}

		// property
		System.out.println("    user.dir=" + System.getProperty("user.dir"));
		System.out.println("    foo=" + System.getProperty("foo"));
	}
}

// java -Dfoo=bar -cp target Main arg1 arg2
// -D<name>=<value> set a system property
